﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace AMatysiak.Web
{
    public static class IP
    {
        public static IPAddress GetIPEndPoint(this TcpClient e)
        {
            Socket socket = e.Client;
            IPEndPoint point = (IPEndPoint)socket.RemoteEndPoint;
            return point.Address;
        }

        public static int GetPortEndPoint(this TcpClient e)
        {
            Socket socket = e.Client;
            IPEndPoint point = (IPEndPoint)socket.RemoteEndPoint;
            return point.Port;
        }
    }
}
